package com.spring.cn.config.cycle;

/**
 * @author liangd
 * date 2020-11-14 11:41
 * code  bean生命周期测试类
 */
public class CarBean {
    /**
     * 构造方法
     */
    public CarBean(){
        System.out.println("Car's Constructors...");
    }

    private String brand;

    /**
     * setter方法
     * @param brand
     */
    public void setBrand(String brand) {
        System.out.println("Car's setter...");
        this.brand = brand;
    }

    /**
     * 初始化方法
     */
    private void init(){
        System.out.println("Car's init...");
    }

    /**
     * 销毁方法
     */
    private void destroy(){
        System.out.println("Car's destroy");
    }

    @Override
    public String toString() {
        return "CarBean{" +
                "brand='" + brand + '\'' +
                '}';
    }
}
